package com.foxnicweb.app.domain.patent;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.foxnicweb.app.constants.db.PatentTables.PAT_PATENT;
import javax.persistence.Id;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.Transient;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.foxnicweb.app.domain.patent.meta.PatentMeta;
import com.github.foxnic.commons.lang.DataParser;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 专利案
 * <p>专利案 , 数据表 pat_patent 的PO类型</p>
 * @author 李方捷 , leefangjie@qq.com
 * @since 2023-04-19 10:25:34
 * @sign F08EA29259C536E998F889D08422F28D
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "pat_patent")
@ApiModel(description = "专利案 ; 专利案 , 数据表 pat_patent 的PO类型")
public class Patent extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =PAT_PATENT.$TABLE;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "1234776")
	private Long id;
	
	/**
	 * 案号：案号
	*/
	@ApiModelProperty(required = false,value="案号" , notes = "案号" , example = "WSFM-20200038")
	private String serial;
	
	/**
	 * 案件名称：案件名称
	*/
	@ApiModelProperty(required = false,value="案件名称" , notes = "案件名称" , example = "一种β-烟酰胺单核苷酸的工艺制备方法")
	private String title;
	
	/**
	 * 提案名称：提案名称
	*/
	@ApiModelProperty(required = false,value="提案名称" , notes = "提案名称")
	private String proposalTitle;
	
	/**
	 * ⽴案⽇期：⽴案⽇期
	*/
	@ApiModelProperty(required = false,value="⽴案⽇期" , notes = "⽴案⽇期" , example = "2020-06-11 12:00:00")
	private Date creationTime;
	
	/**
	 * 申请日期：申请日期
	*/
	@ApiModelProperty(required = false,value="申请日期" , notes = "申请日期")
	private Date applicationDate;
	
	/**
	 * 案件状态：案件状态
	*/
	@ApiModelProperty(required = false,value="案件状态" , notes = "案件状态")
	private String projectStage;
	
	/**
	 * 案件等级：案件等级
	*/
	@ApiModelProperty(required = false,value="案件等级" , notes = "案件等级")
	private String level;
	
	/**
	 * 客户：客户
	*/
	@ApiModelProperty(required = false,value="客户" , notes = "客户")
	private String customer;
	
	/**
	 * 销售：销售
	*/
	@ApiModelProperty(required = false,value="销售" , notes = "销售")
	private String sales;
	
	/**
	 * 流程：流程
	*/
	@ApiModelProperty(required = false,value="流程" , notes = "流程")
	private String flow;
	
	/**
	 * 申请号：申请号
	*/
	@ApiModelProperty(required = false,value="申请号" , notes = "申请号")
	private String applicationNumber;
	
	/**
	 * 案件类型：1发明专利 2实用新型 3外观设计
	*/
	@ApiModelProperty(required = false,value="案件类型" , notes = "1发明专利 2实用新型 3外观设计")
	private String subtype;
	
	/**
	 * 申请国家：申请国家
	*/
	@ApiModelProperty(required = false,value="申请国家" , notes = "申请国家")
	private String area;
	
	/**
	 * 申请方式：申请方式
	*/
	@ApiModelProperty(required = false,value="申请方式" , notes = "申请方式")
	private String applicationManner;
	
	/**
	 * IPR：IPR
	*/
	@ApiModelProperty(required = false,value="IPR" , notes = "IPR")
	private String ipr;
	
	/**
	 * 申请人：申请人
	*/
	@ApiModelProperty(required = false,value="申请人" , notes = "申请人")
	private String applicants;
	
	/**
	 * 发明人：发明人
	*/
	@ApiModelProperty(required = false,value="发明人" , notes = "发明人")
	private String inventors;
	
	/**
	 * 联系人：联系人
	*/
	@ApiModelProperty(required = false,value="联系人" , notes = "联系人")
	private String contact;
	
	/**
	 * 送件代理⼈：送件代理⼈
	*/
	@ApiModelProperty(required = false,value="送件代理⼈" , notes = "送件代理⼈")
	private String patentAgent;
	
	/**
	 * 送件代理所：送件代理所
	*/
	@ApiModelProperty(required = false,value="送件代理所" , notes = "送件代理所")
	private String agency;
	
	/**
	 * 服务类型：服务类型
	*/
	@ApiModelProperty(required = false,value="服务类型" , notes = "服务类型")
	private String service;
	
	/**
	 * 订单号：订单号
	*/
	@ApiModelProperty(required = false,value="订单号" , notes = "订单号")
	private String orderSerial;
	
	/**
	 * 备注：备注
	*/
	@ApiModelProperty(required = false,value="备注" , notes = "备注")
	private String remark;
	
	/**
	 * 实质审查：实质审查
	*/
	@ApiModelProperty(required = false,value="实质审查" , notes = "实质审查")
	private Integer isSubexamRequest;
	
	/**
	 * 状态：状态
	*/
	@ApiModelProperty(required = false,value="状态" , notes = "状态" , example = "1")
	private Integer status;
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public Long getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public Patent setId(Long id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 案号<br>
	 * 案号
	 * @return 案号
	*/
	public String getSerial() {
		return serial;
	}
	
	/**
	 * 设置 案号
	 * @param serial 案号
	 * @return 当前对象
	*/
	public Patent setSerial(String serial) {
		this.serial=serial;
		return this;
	}
	
	/**
	 * 获得 案件名称<br>
	 * 案件名称
	 * @return 案件名称
	*/
	public String getTitle() {
		return title;
	}
	
	/**
	 * 设置 案件名称
	 * @param title 案件名称
	 * @return 当前对象
	*/
	public Patent setTitle(String title) {
		this.title=title;
		return this;
	}
	
	/**
	 * 获得 提案名称<br>
	 * 提案名称
	 * @return 提案名称
	*/
	public String getProposalTitle() {
		return proposalTitle;
	}
	
	/**
	 * 设置 提案名称
	 * @param proposalTitle 提案名称
	 * @return 当前对象
	*/
	public Patent setProposalTitle(String proposalTitle) {
		this.proposalTitle=proposalTitle;
		return this;
	}
	
	/**
	 * 获得 ⽴案⽇期<br>
	 * ⽴案⽇期
	 * @return ⽴案⽇期
	*/
	public Date getCreationTime() {
		return creationTime;
	}
	
	/**
	 * 设置 ⽴案⽇期
	 * @param creationTime ⽴案⽇期
	 * @return 当前对象
	*/
	public Patent setCreationTime(Date creationTime) {
		this.creationTime=creationTime;
		return this;
	}
	
	/**
	 * 获得 申请日期<br>
	 * 申请日期
	 * @return 申请日期
	*/
	public Date getApplicationDate() {
		return applicationDate;
	}
	
	/**
	 * 设置 申请日期
	 * @param applicationDate 申请日期
	 * @return 当前对象
	*/
	public Patent setApplicationDate(Date applicationDate) {
		this.applicationDate=applicationDate;
		return this;
	}
	
	/**
	 * 获得 案件状态<br>
	 * 案件状态
	 * @return 案件状态
	*/
	public String getProjectStage() {
		return projectStage;
	}
	
	/**
	 * 设置 案件状态
	 * @param projectStage 案件状态
	 * @return 当前对象
	*/
	public Patent setProjectStage(String projectStage) {
		this.projectStage=projectStage;
		return this;
	}
	
	/**
	 * 获得 案件等级<br>
	 * 案件等级
	 * @return 案件等级
	*/
	public String getLevel() {
		return level;
	}
	
	/**
	 * 设置 案件等级
	 * @param level 案件等级
	 * @return 当前对象
	*/
	public Patent setLevel(String level) {
		this.level=level;
		return this;
	}
	
	/**
	 * 获得 客户<br>
	 * 客户
	 * @return 客户
	*/
	public String getCustomer() {
		return customer;
	}
	
	/**
	 * 设置 客户
	 * @param customer 客户
	 * @return 当前对象
	*/
	public Patent setCustomer(String customer) {
		this.customer=customer;
		return this;
	}
	
	/**
	 * 获得 销售<br>
	 * 销售
	 * @return 销售
	*/
	public String getSales() {
		return sales;
	}
	
	/**
	 * 设置 销售
	 * @param sales 销售
	 * @return 当前对象
	*/
	public Patent setSales(String sales) {
		this.sales=sales;
		return this;
	}
	
	/**
	 * 获得 流程<br>
	 * 流程
	 * @return 流程
	*/
	public String getFlow() {
		return flow;
	}
	
	/**
	 * 设置 流程
	 * @param flow 流程
	 * @return 当前对象
	*/
	public Patent setFlow(String flow) {
		this.flow=flow;
		return this;
	}
	
	/**
	 * 获得 申请号<br>
	 * 申请号
	 * @return 申请号
	*/
	public String getApplicationNumber() {
		return applicationNumber;
	}
	
	/**
	 * 设置 申请号
	 * @param applicationNumber 申请号
	 * @return 当前对象
	*/
	public Patent setApplicationNumber(String applicationNumber) {
		this.applicationNumber=applicationNumber;
		return this;
	}
	
	/**
	 * 获得 案件类型<br>
	 * 1发明专利 2实用新型 3外观设计
	 * @return 案件类型
	*/
	public String getSubtype() {
		return subtype;
	}
	
	/**
	 * 设置 案件类型
	 * @param subtype 案件类型
	 * @return 当前对象
	*/
	public Patent setSubtype(String subtype) {
		this.subtype=subtype;
		return this;
	}
	
	/**
	 * 获得 申请国家<br>
	 * 申请国家
	 * @return 申请国家
	*/
	public String getArea() {
		return area;
	}
	
	/**
	 * 设置 申请国家
	 * @param area 申请国家
	 * @return 当前对象
	*/
	public Patent setArea(String area) {
		this.area=area;
		return this;
	}
	
	/**
	 * 获得 申请方式<br>
	 * 申请方式
	 * @return 申请方式
	*/
	public String getApplicationManner() {
		return applicationManner;
	}
	
	/**
	 * 设置 申请方式
	 * @param applicationManner 申请方式
	 * @return 当前对象
	*/
	public Patent setApplicationManner(String applicationManner) {
		this.applicationManner=applicationManner;
		return this;
	}
	
	/**
	 * 获得 IPR<br>
	 * IPR
	 * @return IPR
	*/
	public String getIpr() {
		return ipr;
	}
	
	/**
	 * 设置 IPR
	 * @param ipr IPR
	 * @return 当前对象
	*/
	public Patent setIpr(String ipr) {
		this.ipr=ipr;
		return this;
	}
	
	/**
	 * 获得 申请人<br>
	 * 申请人
	 * @return 申请人
	*/
	public String getApplicants() {
		return applicants;
	}
	
	/**
	 * 设置 申请人
	 * @param applicants 申请人
	 * @return 当前对象
	*/
	public Patent setApplicants(String applicants) {
		this.applicants=applicants;
		return this;
	}
	
	/**
	 * 获得 发明人<br>
	 * 发明人
	 * @return 发明人
	*/
	public String getInventors() {
		return inventors;
	}
	
	/**
	 * 设置 发明人
	 * @param inventors 发明人
	 * @return 当前对象
	*/
	public Patent setInventors(String inventors) {
		this.inventors=inventors;
		return this;
	}
	
	/**
	 * 获得 联系人<br>
	 * 联系人
	 * @return 联系人
	*/
	public String getContact() {
		return contact;
	}
	
	/**
	 * 设置 联系人
	 * @param contact 联系人
	 * @return 当前对象
	*/
	public Patent setContact(String contact) {
		this.contact=contact;
		return this;
	}
	
	/**
	 * 获得 送件代理⼈<br>
	 * 送件代理⼈
	 * @return 送件代理⼈
	*/
	public String getPatentAgent() {
		return patentAgent;
	}
	
	/**
	 * 设置 送件代理⼈
	 * @param patentAgent 送件代理⼈
	 * @return 当前对象
	*/
	public Patent setPatentAgent(String patentAgent) {
		this.patentAgent=patentAgent;
		return this;
	}
	
	/**
	 * 获得 送件代理所<br>
	 * 送件代理所
	 * @return 送件代理所
	*/
	public String getAgency() {
		return agency;
	}
	
	/**
	 * 设置 送件代理所
	 * @param agency 送件代理所
	 * @return 当前对象
	*/
	public Patent setAgency(String agency) {
		this.agency=agency;
		return this;
	}
	
	/**
	 * 获得 服务类型<br>
	 * 服务类型
	 * @return 服务类型
	*/
	public String getService() {
		return service;
	}
	
	/**
	 * 设置 服务类型
	 * @param service 服务类型
	 * @return 当前对象
	*/
	public Patent setService(String service) {
		this.service=service;
		return this;
	}
	
	/**
	 * 获得 订单号<br>
	 * 订单号
	 * @return 订单号
	*/
	public String getOrderSerial() {
		return orderSerial;
	}
	
	/**
	 * 设置 订单号
	 * @param orderSerial 订单号
	 * @return 当前对象
	*/
	public Patent setOrderSerial(String orderSerial) {
		this.orderSerial=orderSerial;
		return this;
	}
	
	/**
	 * 获得 备注<br>
	 * 备注
	 * @return 备注
	*/
	public String getRemark() {
		return remark;
	}
	
	/**
	 * 设置 备注
	 * @param remark 备注
	 * @return 当前对象
	*/
	public Patent setRemark(String remark) {
		this.remark=remark;
		return this;
	}
	
	/**
	 * 获得 实质审查<br>
	 * 实质审查
	 * @return 实质审查
	*/
	public Integer getIsSubexamRequest() {
		return isSubexamRequest;
	}
	
	/**
	 * 设置 实质审查
	 * @param isSubexamRequest 实质审查
	 * @return 当前对象
	*/
	public Patent setIsSubexamRequest(Integer isSubexamRequest) {
		this.isSubexamRequest=isSubexamRequest;
		return this;
	}
	
	/**
	 * 获得 状态<br>
	 * 状态
	 * @return 状态
	*/
	public Integer getStatus() {
		return status;
	}
	
	/**
	 * 设置 状态
	 * @param status 状态
	 * @return 当前对象
	*/
	public Patent setStatus(Integer status) {
		this.status=status;
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return Patent , 转换好的 Patent 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return Patent , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public Patent clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public Patent duplicate(boolean all) {
		com.foxnicweb.app.domain.patent.meta.PatentMeta.$$proxy$$ inst = new com.foxnicweb.app.domain.patent.meta.PatentMeta.$$proxy$$();
		inst.setCreationTime(this.getCreationTime());
		inst.setApplicationNumber(this.getApplicationNumber());
		inst.setInventors(this.getInventors());
		inst.setApplicants(this.getApplicants());
		inst.setRemark(this.getRemark());
		inst.setTitle(this.getTitle());
		inst.setSales(this.getSales());
		inst.setSubtype(this.getSubtype());
		inst.setContact(this.getContact());
		inst.setIsSubexamRequest(this.getIsSubexamRequest());
		inst.setId(this.getId());
		inst.setFlow(this.getFlow());
		inst.setApplicationManner(this.getApplicationManner());
		inst.setArea(this.getArea());
		inst.setPatentAgent(this.getPatentAgent());
		inst.setProposalTitle(this.getProposalTitle());
		inst.setAgency(this.getAgency());
		inst.setLevel(this.getLevel());
		inst.setIpr(this.getIpr());
		inst.setProjectStage(this.getProjectStage());
		inst.setSerial(this.getSerial());
		inst.setService(this.getService());
		inst.setApplicationDate(this.getApplicationDate());
		inst.setCustomer(this.getCustomer());
		inst.setOrderSerial(this.getOrderSerial());
		inst.setStatus(this.getStatus());
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public Patent clone(boolean deep) {
		return EntityContext.clone(Patent.class,this,deep);
	}

	/**
	 * 将 Map 转换成 Patent
	 * @param patentMap 包含实体信息的 Map 对象
	 * @return Patent , 转换好的的 Patent 对象
	*/
	@Transient
	public static Patent createFrom(Map<String,Object> patentMap) {
		if(patentMap==null) return null;
		Patent po = create();
		EntityContext.copyProperties(po,patentMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 Patent
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return Patent , 转换好的的 Patent 对象
	*/
	@Transient
	public static Patent createFrom(Object pojo) {
		if(pojo==null) return null;
		Patent po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 Patent，等同于 new
	 * @return Patent 对象
	*/
	@Transient
	public static Patent create() {
		return new com.foxnicweb.app.domain.patent.meta.PatentMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setCreationTime(DataParser.parse(Date.class, map.get(PatentMeta.CREATION_TIME)));
			this.setApplicationNumber(DataParser.parse(String.class, map.get(PatentMeta.APPLICATION_NUMBER)));
			this.setInventors(DataParser.parse(String.class, map.get(PatentMeta.INVENTORS)));
			this.setApplicants(DataParser.parse(String.class, map.get(PatentMeta.APPLICANTS)));
			this.setRemark(DataParser.parse(String.class, map.get(PatentMeta.REMARK)));
			this.setTitle(DataParser.parse(String.class, map.get(PatentMeta.TITLE)));
			this.setSales(DataParser.parse(String.class, map.get(PatentMeta.SALES)));
			this.setSubtype(DataParser.parse(String.class, map.get(PatentMeta.SUBTYPE)));
			this.setContact(DataParser.parse(String.class, map.get(PatentMeta.CONTACT)));
			this.setIsSubexamRequest(DataParser.parse(Integer.class, map.get(PatentMeta.IS_SUBEXAM_REQUEST)));
			this.setId(DataParser.parse(Long.class, map.get(PatentMeta.ID)));
			this.setFlow(DataParser.parse(String.class, map.get(PatentMeta.FLOW)));
			this.setApplicationManner(DataParser.parse(String.class, map.get(PatentMeta.APPLICATION_MANNER)));
			this.setArea(DataParser.parse(String.class, map.get(PatentMeta.AREA)));
			this.setPatentAgent(DataParser.parse(String.class, map.get(PatentMeta.PATENT_AGENT)));
			this.setProposalTitle(DataParser.parse(String.class, map.get(PatentMeta.PROPOSAL_TITLE)));
			this.setAgency(DataParser.parse(String.class, map.get(PatentMeta.AGENCY)));
			this.setLevel(DataParser.parse(String.class, map.get(PatentMeta.LEVEL)));
			this.setIpr(DataParser.parse(String.class, map.get(PatentMeta.IPR)));
			this.setProjectStage(DataParser.parse(String.class, map.get(PatentMeta.PROJECT_STAGE)));
			this.setSerial(DataParser.parse(String.class, map.get(PatentMeta.SERIAL)));
			this.setService(DataParser.parse(String.class, map.get(PatentMeta.SERVICE)));
			this.setApplicationDate(DataParser.parse(Date.class, map.get(PatentMeta.APPLICATION_DATE)));
			this.setCustomer(DataParser.parse(String.class, map.get(PatentMeta.CUSTOMER)));
			this.setOrderSerial(DataParser.parse(String.class, map.get(PatentMeta.ORDER_SERIAL)));
			this.setStatus(DataParser.parse(Integer.class, map.get(PatentMeta.STATUS)));
			// others
			return true;
		} else {
			try {
				this.setCreationTime( (Date)map.get(PatentMeta.CREATION_TIME));
				this.setApplicationNumber( (String)map.get(PatentMeta.APPLICATION_NUMBER));
				this.setInventors( (String)map.get(PatentMeta.INVENTORS));
				this.setApplicants( (String)map.get(PatentMeta.APPLICANTS));
				this.setRemark( (String)map.get(PatentMeta.REMARK));
				this.setTitle( (String)map.get(PatentMeta.TITLE));
				this.setSales( (String)map.get(PatentMeta.SALES));
				this.setSubtype( (String)map.get(PatentMeta.SUBTYPE));
				this.setContact( (String)map.get(PatentMeta.CONTACT));
				this.setIsSubexamRequest( (Integer)map.get(PatentMeta.IS_SUBEXAM_REQUEST));
				this.setId( (Long)map.get(PatentMeta.ID));
				this.setFlow( (String)map.get(PatentMeta.FLOW));
				this.setApplicationManner( (String)map.get(PatentMeta.APPLICATION_MANNER));
				this.setArea( (String)map.get(PatentMeta.AREA));
				this.setPatentAgent( (String)map.get(PatentMeta.PATENT_AGENT));
				this.setProposalTitle( (String)map.get(PatentMeta.PROPOSAL_TITLE));
				this.setAgency( (String)map.get(PatentMeta.AGENCY));
				this.setLevel( (String)map.get(PatentMeta.LEVEL));
				this.setIpr( (String)map.get(PatentMeta.IPR));
				this.setProjectStage( (String)map.get(PatentMeta.PROJECT_STAGE));
				this.setSerial( (String)map.get(PatentMeta.SERIAL));
				this.setService( (String)map.get(PatentMeta.SERVICE));
				this.setApplicationDate( (Date)map.get(PatentMeta.APPLICATION_DATE));
				this.setCustomer( (String)map.get(PatentMeta.CUSTOMER));
				this.setOrderSerial( (String)map.get(PatentMeta.ORDER_SERIAL));
				this.setStatus( (Integer)map.get(PatentMeta.STATUS));
				// others
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setCreationTime(DataParser.parse(Date.class, r.getValue(PatentMeta.CREATION_TIME)));
			this.setApplicationNumber(DataParser.parse(String.class, r.getValue(PatentMeta.APPLICATION_NUMBER)));
			this.setInventors(DataParser.parse(String.class, r.getValue(PatentMeta.INVENTORS)));
			this.setApplicants(DataParser.parse(String.class, r.getValue(PatentMeta.APPLICANTS)));
			this.setRemark(DataParser.parse(String.class, r.getValue(PatentMeta.REMARK)));
			this.setTitle(DataParser.parse(String.class, r.getValue(PatentMeta.TITLE)));
			this.setSales(DataParser.parse(String.class, r.getValue(PatentMeta.SALES)));
			this.setSubtype(DataParser.parse(String.class, r.getValue(PatentMeta.SUBTYPE)));
			this.setContact(DataParser.parse(String.class, r.getValue(PatentMeta.CONTACT)));
			this.setIsSubexamRequest(DataParser.parse(Integer.class, r.getValue(PatentMeta.IS_SUBEXAM_REQUEST)));
			this.setId(DataParser.parse(Long.class, r.getValue(PatentMeta.ID)));
			this.setFlow(DataParser.parse(String.class, r.getValue(PatentMeta.FLOW)));
			this.setApplicationManner(DataParser.parse(String.class, r.getValue(PatentMeta.APPLICATION_MANNER)));
			this.setArea(DataParser.parse(String.class, r.getValue(PatentMeta.AREA)));
			this.setPatentAgent(DataParser.parse(String.class, r.getValue(PatentMeta.PATENT_AGENT)));
			this.setProposalTitle(DataParser.parse(String.class, r.getValue(PatentMeta.PROPOSAL_TITLE)));
			this.setAgency(DataParser.parse(String.class, r.getValue(PatentMeta.AGENCY)));
			this.setLevel(DataParser.parse(String.class, r.getValue(PatentMeta.LEVEL)));
			this.setIpr(DataParser.parse(String.class, r.getValue(PatentMeta.IPR)));
			this.setProjectStage(DataParser.parse(String.class, r.getValue(PatentMeta.PROJECT_STAGE)));
			this.setSerial(DataParser.parse(String.class, r.getValue(PatentMeta.SERIAL)));
			this.setService(DataParser.parse(String.class, r.getValue(PatentMeta.SERVICE)));
			this.setApplicationDate(DataParser.parse(Date.class, r.getValue(PatentMeta.APPLICATION_DATE)));
			this.setCustomer(DataParser.parse(String.class, r.getValue(PatentMeta.CUSTOMER)));
			this.setOrderSerial(DataParser.parse(String.class, r.getValue(PatentMeta.ORDER_SERIAL)));
			this.setStatus(DataParser.parse(Integer.class, r.getValue(PatentMeta.STATUS)));
			return true;
		} else {
			try {
				this.setCreationTime( (Date)r.getValue(PatentMeta.CREATION_TIME));
				this.setApplicationNumber( (String)r.getValue(PatentMeta.APPLICATION_NUMBER));
				this.setInventors( (String)r.getValue(PatentMeta.INVENTORS));
				this.setApplicants( (String)r.getValue(PatentMeta.APPLICANTS));
				this.setRemark( (String)r.getValue(PatentMeta.REMARK));
				this.setTitle( (String)r.getValue(PatentMeta.TITLE));
				this.setSales( (String)r.getValue(PatentMeta.SALES));
				this.setSubtype( (String)r.getValue(PatentMeta.SUBTYPE));
				this.setContact( (String)r.getValue(PatentMeta.CONTACT));
				this.setIsSubexamRequest( (Integer)r.getValue(PatentMeta.IS_SUBEXAM_REQUEST));
				this.setId( (Long)r.getValue(PatentMeta.ID));
				this.setFlow( (String)r.getValue(PatentMeta.FLOW));
				this.setApplicationManner( (String)r.getValue(PatentMeta.APPLICATION_MANNER));
				this.setArea( (String)r.getValue(PatentMeta.AREA));
				this.setPatentAgent( (String)r.getValue(PatentMeta.PATENT_AGENT));
				this.setProposalTitle( (String)r.getValue(PatentMeta.PROPOSAL_TITLE));
				this.setAgency( (String)r.getValue(PatentMeta.AGENCY));
				this.setLevel( (String)r.getValue(PatentMeta.LEVEL));
				this.setIpr( (String)r.getValue(PatentMeta.IPR));
				this.setProjectStage( (String)r.getValue(PatentMeta.PROJECT_STAGE));
				this.setSerial( (String)r.getValue(PatentMeta.SERIAL));
				this.setService( (String)r.getValue(PatentMeta.SERVICE));
				this.setApplicationDate( (Date)r.getValue(PatentMeta.APPLICATION_DATE));
				this.setCustomer( (String)r.getValue(PatentMeta.CUSTOMER));
				this.setOrderSerial( (String)r.getValue(PatentMeta.ORDER_SERIAL));
				this.setStatus( (Integer)r.getValue(PatentMeta.STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}